package xfuzzy.xfghl.algorithm;

/**
 * Clase que representa los resultados del algoritmo genetico
 * @author Alberto David Fernandez Fernandez
 * */

public class ResultGA {

	/**
	 * Numero de iteraciones del algoritmo
	 * */
	private int numIterations;
	
	/**
	 * Numero de evaluaciones de individuos
	 * */
	private int numEvaluations;
	
	/**
	 * Valor del mejor individuo encontrado
	 * */
	private double best;
	
	/**
	 * Tiempo total de ejecucion del algoritmo
	 * */
	private long time;
	
	/**
	 * Constructor de la case
	 * */
	
	public ResultGA()  {
		
		this.numIterations = 0;
		this.numEvaluations = 0;
		this.best = Double.MAX_VALUE;
	}
	
	public int getNumGenerations() {
		return numIterations;
	}

	public void setNumIterations(int numGenerations) {
		this.numIterations = numGenerations;
	}

	public synchronized void increaseNumIterations()  {
		this.numIterations++;
	}

	public int getNumEvaluations() {
		return numEvaluations;
	}

	public synchronized void setNumEvaluations(int numEvaluations) {
		this.numEvaluations = numEvaluations;
	}
	
	public synchronized void increaseNumEvaluations(int incr)  {
		this.numEvaluations += incr;
	}

	public double getBest() {
		return best;
	}

	public void setBest(double best) {
		this.best = best;
	}

	public long getTime() {
		return time;
	}

	public void setTime(long time) {
		this.time = time;
	}
}
